module OrdersHelper
  
  def task_type_class_name(type_name)
    @task_type_class_name ||= {}
    @task_type_class_name[type_name] ||= "type_#{@task_type_class_name.keys.size}"
  end

  def task_type
    raw "<option value='提醒'>--请选择--</option>
    <option value='提醒'>提醒</option>
    <option value='电话'>电话</option>
    <option value='传真'>传真</option>
    <option value='电子邮件'>电子邮件</option>
    <option value='开会'>开会</option>
    <option value='回访'>回访</option>
    <option value='出差'>出差</option>
    <option value='通知'>通知</option>
    <option value='督促'>督促</option>
    <option value='批评'>批评</option>
    <option value='报告'>报告</option>
    <option value='感谢'>感谢</option>
    <option value='演示'>演示</option>"
  end
  
  def title_of_orders
    if params[:status_request].present?
      "所有<b>『#{t params[:status_request]}』</b>中的预订单"
    elsif params[:filter].present? and params[:on].nil?
      "所有<b>『#{t params[:filter]}』</b>的预订单"
    elsif params[:filter].present? and params[:on].present?
      "所有<b>『#{t "#{params[:filter]}_for"}#{params[:on]}』</b>的预订单"
    else
      "所有预订单"
    end
  end

  def filter_image_tag
    image_tag 'orders/down.png', :id => "down_png", :title => '更多过滤器', :alt => '更多过滤器', :class => :select
  end
end
